<?php
/**
 * The default template for displaying content. Used for both single and index/archive/search.
 *
 * @package WordPress
 * @subpackage Bootstrapper
 * @since Bootstrapper 1.0
 */
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

	<?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
        <div class="entry-thumbnail">
            <?php the_post_thumbnail(); ?>
        </div>
    <?php endif; ?>
    
	<?php if ( is_single() ) : ?>
        <header class="page-header">
            <h1 class="entry-title"><?php the_title(); ?></h1>
        </header><!-- .entry-header -->
    <?php else : ?>
        <h1 class="entry-title">
            <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'bootstrapper' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
        </h1>
    <?php endif; // is_single() ?>
    
    <div class="entry-meta">
        <?php bootstrapper_entry_meta(); ?>
        <?php edit_post_link( __( 'Edit', 'bootstrapper' ), '<span class="edit-link"><i class="icon-edit"></i> <small class="muted">', '</small></span>' ); ?>
    </div><!-- .entry-meta -->

	<?php if ( is_search() ) : // Only display Excerpts for Search ?>
        <div class="entry-summary">
            <?php the_excerpt(); ?>
        </div><!-- .entry-summary -->
	<?php else : ?>
        <div class="entry-content">
            <?php the_content( __( 'View more <i class="meta-nav icon-chevron-right"></i>', 'bootstrapper' ) ); ?>
            <?php bootstrapper_link_pages(); ?>
        </div><!-- .entry-content -->
	<?php endif; ?>

	<footer class="entry-meta">
		<?php if ( comments_open() && ! is_single() ) : ?>
			<div class="comments-link">
				<?php comments_popup_link( '<span class="leave-reply"><i class="icon-comment"></i> ' . __( 'Leave a comment', 'bootstrapper' ) . '</span>', __( 'One comment so far', 'bootstrapper' ), __( 'View all % comments', 'bootstrapper' ) ); ?>
			</div><!-- .comments-link -->
		<?php endif; // comments_open() ?>
		<?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?>
			<?php get_template_part( 'author-bio' ); ?>
		<?php endif; ?>
	</footer><!-- .entry-meta -->

</article><!-- #post -->
